package com.wz.jiangsu.main.string;

public class GetValue {
    public static void main(String[] args) {
        int value = getFenFromString("hello");
        System.out.println(value);
    }

    private static int getFenFromString(String target) {

        char[] charArray = target.toCharArray();
        int sum = 0;
        for (int i = 0; i < charArray.length -1; i++) {
            int value = charArray[i];
            sum += Math.abs(value -(int) charArray[i + 1] );
        }

        return sum;
    }
}
